﻿// This code is released under the BSD license.
namespace PugLib.UnitTest
{
    #region

    using System.Collections.Generic;
    using Collections;
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    #endregion

    /// <summary>
    ///This is a test class for MultiMapSetTest and is intended
    ///to contain all MultiMapSetTest Unit Tests
    ///</summary>
    [TestClass]
    public class MultiMapSetTest
    {
        [TestMethod]
        public void HasValueTest()
        {
            MultiMapSet<int, int> target = new MultiMapSet<int, int>();
            const int key = 8;
            const int value = 9;
            const bool expected = true;
            target.Add(key, value);
            target.Add(key, value * 2);
            bool actual = target.HasValue(key, value);
            Assert.AreEqual(expected, actual);

            HashSet<int> values = target.GetValues(key);
            Assert.IsTrue(values.Count > 0);

            target.Remove(key, value);
            Assert.IsFalse(target.HasValue(key, value));

            Assert.IsFalse(target.HasValue(-1, -1));
        }
    }
}